home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / FWString / Include / FWStrgAr.tpp < prev    next >
Encoding:
Text File  |  1994-04-21  |  1.4 KB  |  49 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWStrgAr.tpp
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/28/94
  7. //
  8. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWSTRGAR_H
  13. #include "FWStrgAr.h"
  14. #endif
  15.  
  16. #ifndef FWARSTRM_H
  17. #include "FWArStrm.h"
  18. #endif
  19.  
  20. #pragma segment Strings
  21.  
  22. #include "FWStrs.tpp"
  23.  
  24. //----------------------------------------------------------------------------------------
  25. // FW_TStringArchiver<tString>::Read
  26. //----------------------------------------------------------------------------------------
  27.  
  28. template <class tString>
  29. void * FW_TStringArchiver<tString>::Read(FW_CReadableArchive & archive)
  30. {
  31.     tString * string = FW_NEW(tString, ());
  32.     FW_CStringArchiver::Read(archive, *string);
  33.     return string;
  34. }
  35.  
  36. //----------------------------------------------------------------------------------------
  37. // FW_TStringArchiver<tString>::Write
  38. //----------------------------------------------------------------------------------------
  39.  
  40. template <class tString>
  41. void FW_TStringArchiver<tString>::Write(FW_CWritableArchive & archive, 
  42.                                                     const void *object)
  43. {
  44.     const FW_CString* objectString = (const FW_CString*)object;
  45.     const tString* string = FW_DYNAMIC_CAST(tString, objectString);
  46.     FW_ASSERT(string != 0);
  47.     FW_CStringArchiver::Write(archive, *string);
  48. }
  49.